home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
chrchpr4.arc
/
MCNAMES1.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
3KB
|
116 lines
* Program MCNAMES1 - Adds a Small Church name to the MDIRFILE
Store T to LEVEL3
Do while LEVEL3
Store T to nogood
Store 'SSSC=' to acttype
Accept 'Enter Small Church code to be added (example: JRH = Jr. High): ' to IC
Do while nogood
If !(IC) = 'Q'
Store F to invalid
RETURN
endif
If len(IC) = 3
Store acttype+IC to ICODE
Find &ICODE
If # = 0
Store F to nogood
else
? 'Duplicate Small Church code found. [',spact,']'
? ' '
Accept 'Enter another Small Church code: ' to IC
endif
else
Accept 'Small Church code does not have 3 characters. Enter again: ' to IC
endif
enddo
APPEND BLANK
Accept 'Enter name for the above code: ' to XNAME
Replace spact with acttype+IC+' '+$(XNAME,1,20)
? ' '
? spact, ' - NOW ADDED '
? ' '
? 'Do you want to change the codes of all members of '
Accept 'an existing Small Church class to this new name? ' to XY
If !(XY) = 'Y'
Store T to nogood
Accept 'Enter previous Small Church code: ' to OC
Do while nogood
If !(XY) = 'Q' .or. !(OC) = 'Q'
Store F to nogood
else
Store acttype+OC to xysearch
Find &xysearch
If # = 0
Accept 'No Small Church code found with this name. Enter another ' to OC
else
Store F to nogood
? ' '
? 'Note: This does not change the Small Church teacher for this code.'
? 'That must be done manually by finding the individual teacher and'
? 'changing field = "TEACH:SSSC".'
Accept 'Now about to go through the MEMBERS file for changes. Ok? ' to XY
If !(XY) <> 'Y'
Store F to nogood
else
Select secondary
Store d+':members' to mfile
USE &MFILE index &MFILE
Store 0 to recm
Store 0 to recc
Store 0 to recnumb
Do while .not. EOF
If $(SS:SC:MEMB,1,3) = OC
Replace SS:SC:MEMB with IC+' '+$(SS:SC:MEMB,5,1)
? last:name,first:name,' - Small Church changed to ',IC
Store recm+1 to recm
endif
SKIP
Store recc+1 to recc
If recc = 100
Store 0 to recc
Store recnumb+100 to recnumb
? recnumb,' RECORDS PROCESSED.'
endif
enddo
Select primary
? recm,' RECORDS CHANGED TO NEW CODE.'
ENDIF
ENDIF
endif
enddo
else
? ' No changes made.'
endif
ENDDO
RETURN
D '
? ' '
? 'Do you want to change the codes of all members of '
Accept 'an existing Sunday School class to this new name? ' to XY
If !(XY) = 'Y'
Store T to nogood
Accept 'Enter previous Sunday School code: ' Set console on
endif
RETURN
SE mdirfilx
Copy to SPACFILE STRUCTURE
Use SPACFILE
Select primary
Store 1 to actcount
Store ' ' to actlist
Store chr(31) to chr31
Do while $(spact,1,4) = 'SPAC'
Select secondary
Append blank
replace SPACT with $(P.SPACT,6,4)
If actcount<64
Store actlist+$(spact,1,4) to actlist
Store actcount+1 to actcount
else
? 'Special Activities found are: ',actlist
Store ' '+$(spact,1,4) to actlist
endif
Select primary
SKIP
enddo
Sel